package com.twb.core.security;

import java.util.HashMap;
import java.util.Map;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "twb.security")
public class TwbSecurityProperties {

	private String tokenName = "X-Token";
	private String appTokenName = "X-AppToken";
	private String appSecretName = "X-AppSecret";
	private String appIdName = "X-AppId";
	private Boolean projectAuth=true;
	private Map<String,Long> timeOut = new HashMap<String,Long>();
	
	public String getTokenName() {
		return tokenName;
	}
	public void setTokenName(String tokenName) {
		this.tokenName = tokenName;
	}
	public String getAppTokenName() {
		return appTokenName;
	}
	public void setAppTokenName(String appTokenName) {
		this.appTokenName = appTokenName;
	}
	public String getAppSecretName() {
		return appSecretName;
	}
	public void setAppSecretName(String appSecretName) {
		this.appSecretName = appSecretName;
	}
	public String getAppIdName() {
		return appIdName;
	}
	public void setAppIdName(String appIdName) {
		this.appIdName = appIdName;
	}
	public Boolean getProjectAuth() {
		return projectAuth;
	}
	public void setProjectAuth(Boolean projectAuth) {
		this.projectAuth = projectAuth;
	}
	public Map<String, Long> getTimeOut() {
		if(timeOut.isEmpty()) {
			timeOut.put("sys", 3600L);
		}
		return timeOut;
	}
	public void setTimeOut(Map<String, Long> timeOut) {
		this.timeOut = timeOut;
	}
	
}
